package org.jeecg.modules.demo.zhidingzhouqigongzuo.service.impl;

import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.demo.zhidingzhouqigongzuo.entity.ZhidingListDto;
import org.jeecg.modules.demo.zhidingzhouqigongzuo.entity.Zhidingzhouqigongzuo;
import org.jeecg.modules.demo.zhidingzhouqigongzuo.mapper.ZhidingzhouqigongzuoMapper;
import org.jeecg.modules.demo.zhidingzhouqigongzuo.service.IZhidingzhouqigongzuoService;
import org.jeecg.modules.system.entity.SysDataLog;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 制定周期性工作
 * @Author: jeecg-boot
 * @Date:   2025-10-09
 * @Version: V1.0
 */
@Service
public class ZhidingzhouqigongzuoServiceImpl extends ServiceImpl<ZhidingzhouqigongzuoMapper, Zhidingzhouqigongzuo> implements IZhidingzhouqigongzuoService {

    @Autowired
    private ZhidingzhouqigongzuoMapper zhidingzhouqigongzuoMapper;

    //获取部门id
    public String getDepartId() {
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String departId = sysUser.getDepartIds();
        return departId;
    }
    //获取责任主管
    @Override
    public List<SysUser> getZerenzhuguanid() {
        //获取部门id
        String departId = getDepartId();
        return zhidingzhouqigongzuoMapper.queryUserList(departId);
    }

    @Override
    public List<SysDepart> getPeihebumen(){
        return zhidingzhouqigongzuoMapper.queryDepartList();
    }


}
